<html>
<head>
	<script src="settings.js"></script>
	
<script type="text/javascript">

var thing = {a:1, b:"2", c:function(){return 3;}, d:"@this.b+this.a", e:null};
var NULL = null;
var UNDEF = Function.Null();

function testObject$Get() {
	assertNotUndefined("$get is defined", Object.$get);
	assertEquals("$get numeric", 1, Object.$get(thing, "a"));
	assertEquals("$get string", "2", Object.$get(thing, "b"));
	assertEquals("$get function", "function", typeof Object.$get(thing, "c"));
	assertEquals("$get closure", "21", Object.$get(thing, "d"));
	assertEquals("$get null", null, Object.$get(thing, "e"));
	assertUndefined("$get undefined", Object.$get(thing, "f"));
}

function testObject$Set() {
	var stuff = {};
	Object.$set(stuff, "a", 1);
	assertEquals(1, stuff.a);
}

function testIsDefined() {
	assertTrue("string", Object.isDefined(String.Empty));
	assertTrue("null value", Object.isDefined(NULL));
	assertFalse("undefined variable", Object.isDefined(UNDEF));
}

function testHasValue() {
	assertTrue(Object.hasValue(thing));
	assertTrue($V("h"));
	assertFalse(Object.hasValue(NULL));
	assertFalse(Object.hasValue(UNDEF));
	assertTrue(Object.hasValue(0));
	assertTrue(Object.hasValue(String.Empty));
}

function testHashMapBehaviorStillExists() {
	var map = {};
	for (var newMember in map)
		fail("There should be no new members in hashmap (Object.prototype)");
}

</script>
</head>
</html>